package com.example.smartmallserver.demos.web.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    Integer status;
    String message;
    Object data;

    public static Result success(){
        return new Result(200,"",null);
    }

    public static Result success(Object data){
        return new Result(200,"",data);
    }

    public static Result error(String message){
        return new Result(404,message,null);
    }
    public static Result error(){
        return new Result(404,"",null);
    }
    public static Result successStatus(Integer status){
        return new Result(status,"",null);
    }
    public static Result errorStatus(Integer status){
        return new Result(status,"",null);
    }
}
